<?php
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//
// DLMan by Shedd Technologies International		  				//
// http://www.dlman.com | info@dlman.com							//
// Copyright 2003 by STI, All rights reserved.						//
// ---------------------------------------------------------------- //
// Usage of this software is governed by the terms of GPL. 	    	//
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//

//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
//INITIALIZATION
require_once("global.php");
menu();
if(!isset($message)){
	$message=check();
}
global $content;
$content="";
if(!isset($action)){
	//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
	//CONTENT GENERATION
		///////////////////////////////////////////////////////////////////
		//SETTINGS
			//templates
		if(isset($sarea)){
			require("settings.php");
		}
		///////////////////////////////////////////////////////////////////
		//FILE MANAGEMENT
		elseif(isset($farea)){
			require("files.php");
		}
		///////////////////////////////////////////////////////////////////
		//USER MANAGEMENT
		elseif(isset($uarea)){
			require("users.php");
		}
		///////////////////////////////////////////////////////////////////
		//LOG MANAGEMENT
		elseif(isset($larea)){
			require("logs.php");
		}
		///////////////////////////////////////////////////////////////////
		//MAIN PAGE
		else{
			require("main.php");
		}
	//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
	//PAGE DELIVERY
	ob_start();
	$output=sheader();
	$output.='<table cellspacing="0" cellpadding="2" border="0" width="100%">';
	$output.='<tr nowrap><td colspan="2" align="center"><p style="background-color:yellow;"><b>'.$message.'</b></p></td></tr>';
	$output.='<tr nowrap><!--MENU CELL--><td valign="top">';
	$output.=$menu;//menu is a global variable set in menu()
	$output.='</td><!--end MENU CELL--><!--CONTENT CELL--><td valign="top" align="left">';
	$output.=$content;//content is a global variable set in external files
	$output.='</td><!--end CONTENT CELL--></tr></table>';
	$output.=$config->copypow;
	$output.=footer();
	$data = addslashes($output);
	eval("echo stripslashes(\"$data\");");
	$final=ob_get_contents();
	ob_end_clean();
	print $final;
	//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
}//end no action
elseif($action=="cc_delete"){
	//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
	/*
		$thetype must be set to the table name 
		$idfield must be set to the id field name
		$idval must be set to the id value for the item
		$urlback must be set to the present url + query string
		$confirm must be set to 'Yes'
	*/
		$tt=$thetype;
		if(isset($tt)){
			if($confirm=="Yes"){
				//OK to delete
				$query="DELETE FROM ".$tt." WHERE $idfield='$idval'";
				$rs=mysql_query($query) or die("Delete Failed!<br>$query<br>".mysql_error());
				$mssg="Item%20Deleted";
				$url="$PHP_SELF?message=$mssg";
			}
			else{
				//Not OK to delete
				$error=true;
				$url=$urlback;
			}
			//new location
			if(!$error)print 'Delete Successful!<br>';
			else print 'Delete Failed!<br>';
			print '<a href="'.$url.'">Click to Continue</a>';
		}
		else{
			print "Invalid Type!";
		}
	//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
}//end action==cc_delete
?>